<!DOCTYPE html>
<html>
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script>
			var dojoConfig = {
					async: true,
					isDebug: true,
					baseUrl: "/public/dojo/",
					packages: [
						{ name: "dojo", location: "dojo-lib/dojo"},
						{ name: "dijit", location: "dojo-lib/dijit"},
						{ name: "dojox", location: "dojo-lib/dojox"},
						{ name: "newer", location: "newer"},
						{ name: "app", location: "newer/app" },
						{ name: "widget", location: "newer/widgets" }
					]
				};
		</script>
		<link rel="stylesheet" href="/public/dojo/dojo-lib/dijit/themes/claro/claro.css">
		<script src="/public/dojo/dojo-lib/dojo/dojo.js"></script>
		
		<link rel="stylesheet" href="/public/dojo/newer/widgets/css/PostDisplayWidget.css" media="screen">
		<link rel="stylesheet" href="/public/dojo/newer/widgets/css/DisplayWidget.css" media="screen">
	</head>
	<body class="claro">
		<script>
			require(["dojo/_base/xhr", "dojo/dom", "dojo/_base/array", "widget/GridDisplayWidget", "dojo/domReady!"], 
				function(xhr, dom, arrayUtil, GridDisplayWidget) {

				var posts = xhr.get({
					url: "/Posts/getFriendsPostsByUserId?uid=4",
					handleAs: "json"
				});
				
				posts.then(function(posts) {
					var postContainer = dom.byId("posts-div");	
					var dw = new GridDisplayWidget({
						numberOfCol: 1, 
						numberOfRow: -1,
						data: posts,
						dataType: "PostWidget"
					}).placeAt(postContainer);
				});
			});
		</script>
		<div id="posts-div"></h1>
	</body>
</html>
